<script setup>
const props = defineProps(["isShow"]);
const emits = defineEmits(["hide"]);
</script>
<template>
  <teleport to="body">
    <div
      :="$attrs"
      @click.self="$emit('hide')"
      class="mask"
      v-show="props.isShow"
    >
      <slot></slot>
    </div>
  </teleport>
</template>

<style scoped>
.mask {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 9999;
}
</style>
